#include<my_head.h>
//不传参
void *task_func(void *arg){
    printf("我是子线程\n");
}


int main(int argc, char const *argv[])
{
    pthread_t tid = 0;
    int ret = 0;
    if(0 != (ret = pthread_create(&tid,NULL,task_func,NULL))){
        printf("pthread_creat error:[%d] [%s]\n",ret,strerror(ret));
        exit(EXIT_FAILURE);
    }
    printf("我是主线程\n");
    sleep(100);
    return 0;
}
/*
void *task_func(void *arg){
    printf("我是子进程\n");
}
int main(int argc, const char *argv[]){
    pthread_t tid = 0;
    int ret = 0;
    if(0 != (ret = pthread_create(&tid,NULL,task_func,NULL))){
        printf("pthread_creat error : [%d] [%s]\n",ret,strerror(ret));
        exit(EXIT_FAILURE);
    }
    printf("我是主线程\n");
    sleep(100);
    return 0;
}
  */  
    
    
    
    
    
    
    
    
    
    
    
    
